﻿#region Namespace References

using System;
using System.Collections.Generic;
using System.Windows.Forms;

#endregion

namespace DynConDevCorp.OpenArch.SmartData.BillingDemo1.ApplicationForms
{
    public partial class ApplicationForm : Form
    {
        #region Constructors

        public ApplicationForm()
        {
            InitializeComponent();
        }

        #endregion

        #region Private Instance Methods

        private void singleToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var form = new OrderForm();
            form.MdiParent = this;
            form.Show();
        }

        private void tsmiFileExit_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void tsmiHelpAbout_Click(object sender, EventArgs e)
        {
            using (var form = new ApplicationAboutBox())
            {
                form.ShowDialog();
            }
        }

        private void tsmiViewCustomersAll_Click(object sender, EventArgs e)
        {
            var form = new CustomersForm();
            form.MdiParent = this;
            form.Show();
        }

        private void tsmiViewCustomersSingle_Click(object sender, EventArgs e)
        {
            var form = new CustomerForm();
            form.MdiParent = this;
            form.Show();
        }

        private void tsmiViewOrdersAll_Click(object sender, EventArgs e)
        {
            var form = new OrdersForm();
            form.MdiParent = this;
            form.Show();
        }

        private void tsmiViewProductsAll_Click(object sender, EventArgs e)
        {
            var form = new ProductsForm();
            form.MdiParent = this;
            form.Show();
        }

        private void tsmiViewProductsSingle_Click(object sender, EventArgs e)
        {
            var form = new ProductForm();
            form.MdiParent = this;
            form.Show();
        }


        private void tsmiWindowCascade_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.Cascade);
        }

        private void tsmiWindowCloseAll_Click(object sender, EventArgs e)
        {
            List<Form> children = new List<Form>(MdiChildren);
            foreach (var child in children)
            {
                child.Close();
            }
        }

        private void tsmiWindowTileHorizontal_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.TileHorizontal);
        }

        private void tsmiWindowTileVertical_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.TileVertical);
        }

        #endregion
    }
}